<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title> Accueil </title>
		<link rel="stylesheet" type="text/css"  media="screen" href="topic.css"/>
	</head>
 
	<body>

		<?php  
			if($_SESSION['log'] == 1){
				include_once("header_connecter.html");
				}else{
				include_once("header_deconnecter.html");
			} 
		?>
		<br/>
		<br/>

		<h1 align="center"> Mon historique </h1>
		<?php
		$sql = "SELECT * FROM historiques ORDER BY historiques.id desc";
		
		$query_historique = mysqli_query($bdd, $sql);
		 
		 
		 while($top= mysqli_fetch_array($query_historique)){
		
		 
		 
	$sql_photo="SELECT * FROM photos WHERE id_bien=".$top['id_bien'];
    $req_photo= mysqli_query($bdd,$sql_photo);
    $photo = mysqli_fetch_array($req_photo);
	

	
		 echo"
		 <table align='center' class='boite5'>
		 
			
		 
		  <tr>
			<td> Photo </td>
			<td> <img src=".$photo['photo']."> </td>
		  </tr>
		  
		  
		  <tr> 
		   <td> Début de la location </td>
		   <td> ".$top['date_debut']." </td>
		  </tr>
		  
		  <tr>
		   <td> Fin de la location </td>
		   <td> ".$top['date_fin']." </td>
		  </tr>
		  
		  <tr>
		   <td> Prix de la location </td>
		   <td> ".$top['prix_location']." </td>
		  </tr>
		  
		  
		 </table>
		 "
		 
		   ;}

		   ?>

	</body>
</html>